package com.zxgllhh.utils;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
/**
 * 
 * @author Zhao,XingGuo
 *
 */
public class PropertyUtils {
	static Properties props = new Properties();

	static {
		try {
			// 发布环境
			//props.load(new FileInputStream("d://zxgllhh.properties"));
			// 生产环境
			 props.load(PropertyUtils.class.getClassLoader().getResourceAsStream("com/zxgllhh/run/zxgllhh.properties"));
		} catch (IOException e1) {
			e1.printStackTrace();
		}
	}

	private PropertyUtils() {
	}

	public static String getProperty(String key) {
		return props.getProperty(key);
	}

	public static void main(String[] args) {
		String projectName = PropertyUtils.getProperty("projectName");
		System.out.println(projectName);
	}
}
